package com.fulihui.information.api;

import org.near.servicesupport.result.BaseResult;
import org.near.servicesupport.result.TPageResult;
import org.near.servicesupport.result.TSingleResult;

import com.fulihui.information.dto.InfoContentCommentsDTO;
import com.fulihui.information.request.*;
import com.fulihui.information.result.ContentCommentsResponse;

/**
 * Created by LM on 2017/4/9.
 */
public interface ContentCommentsService {

    /**
     * 创建评论
     * @param request {@link ContentCommentsCreateRequest}
     * @return
     */
    TSingleResult<String> createComments(ContentCommentsCreateRequest request);

    /**
     * 修改评论
     * @param request {@link ContentCommentsUpdateRequest}
     * @return
     */
    BaseResult updateComments(ContentCommentsUpdateRequest request);

    /**
     * 累加评论点赞数
     * @param request
     * @return
     */
    BaseResult praiseTotalAdd(ContentCommentsPraiseRequest request);

    /**
     * 累加评论回复数
     * @param commentsId 评论id
     * @return
     */
    BaseResult replyTotalAdd(String commentsId);

    /**
     * 分页查询评论
     * @param request {@link ContentCommentsQueryRequest}
     * @return {@link InfoContentCommentsDTO}
     */
    TPageResult<InfoContentCommentsDTO> queryPage(ContentCommentsQueryRequest request);

    /**
     * 分页查询评论(开关控制)
     * @param request {@link ContentCommentsQueryRequest}
     * @return {@link InfoContentCommentsDTO}
     */
    ContentCommentsResponse<InfoContentCommentsDTO> queryPageExt(ContentCommentsQueryRequest request);

    /**
     * 删除评论(级联删除评论回复)
     * @param request {@link ContentCommentsRequest}
     * @return
     */
    BaseResult removeComments(ContentCommentsRequest request);

    /**
     * 根据主键查询评论
     * @param request {@link ContentCommentsRequest}
     * @return {@link InfoContentCommentsDTO}
     */
    TSingleResult<InfoContentCommentsDTO> queryByPK(ContentCommentsRequest request);

    /**
     * 打开关开
     * @return
     */
    BaseResult openOnOff();

    /**
     * 关闭开关
     * @return
     */
    BaseResult closeOnOff();

    /**
     * 查询开关状态
     * @return
     */
    TSingleResult<Boolean> onOff();

    /**
     * 分页查询用户评论
     * @param request
     * @return
     */
    TPageResult<InfoContentCommentsDTO> queryPageUserComments(ContentCommentsQueryRequest request);

}
